-
Notifications
You must be signed in to change notification settings - Fork 2k
Add token streaming support for XMLAdapter #8478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add token streaming support for XMLAdapter #8478
Conversation
dspy/streaming/streaming_listener.py
Outdated
elif isinstance(settings.adapter, ChatAdapter) or settings.adapter is None: | ||
boundary_index = last_tokens.find("[[") | ||
return last_tokens[:boundary_index] | ||
boundary_index = last_tokens.find(f"</{self.signature_field_name}>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: why do we need this change for ChatAdapter
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, it's a codex mess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Support XMLAdapter in
StreamListener
Note
This PR is generated by OpenAI codex, I am testing how deep it can understand DSPy codebase with this specific use case.
It passes on my tests: